package Chapter9;
import java.awt.*;
import java.awt.event.*;
public class Example03 {
	public static void main(String[] args) {
		Frame f=new Frame("my window");
		f.setSize(400,300);
		f.setLocation(300, 200);
		f.setVisible(true);
		f.addWindowListener(new MyWindowListenerr());
	}
	
}
class MyWindowListenerr extends WindowAdapter{
	public void windowClosing(WindowEvent e) {
		Window window=(Window) e.getComponent();
		window.dispose();
	}
}
